package nowcoder;
/**
 * 反转部分单向链表
 */
import java.util.*;
public class Day28_1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = input.nextInt();
        }
        int l = input.nextInt();
        int r = input.nextInt();
        input.close();

        /********反转*********/
        // [l-1, r-1]有(r-l+1)个元素
        for (int curL = l - 1, curR = r - 1; curL < curR; curL++, curR--) {
            swap(arr, curL, curR);
        }
        /********************/

        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i]);
            if(i < arr.length - 1){
                System.out.print(" ");
            }else{
                System.out.println();
            }
        }
    }

    private static void swap(int[] arr, int i, int j) {
        int tmp = arr[i];
        arr[i] = arr[j];
        arr[j] = tmp;
    }
}
